package com.progark.sound.view;

import com.progark.sound.controller.ResultsController;
import com.progark.sound.main.Constants;

import sheep.graphics.Color;
import sheep.graphics.Font;
import sheep.gui.TextButton;
import android.graphics.Canvas;
import android.graphics.Typeface;
import android.view.MotionEvent;

public class ResultsView {

	private Canvas canvas;
	
	private ResultsController resultController;
	private Font font = new Font(255, 255, 255, 50, Typeface.DEFAULT_BOLD, Typeface.BOLD);
	private TextButton menuButton;
	
	public ResultsView(ResultsController rc){
		resultController = rc;
	}

	public void draw(Canvas c){
		this.canvas = c;
		canvas.drawPaint(Color.BLACK);
		canvas.drawText(resultController.endScore()[0], Constants.WIDTH/7, Constants.HEIGHT/8, font);
		canvas.drawText(resultController.endScore()[1], Constants.WIDTH/7, (Constants.HEIGHT/8 + 100), font);
		canvas.drawText(resultController.endScore()[2], Constants.WIDTH/7, (Constants.HEIGHT/8 + 200), font);
		menuButton = new TextButton(Constants.WIDTH / 7,
				Constants.HEIGHT/8 + 400, "Menu", Constants.alternativePaint);
		menuButton.draw(c);
	}
	
	public boolean onTouchDown(MotionEvent event) {
		if (menuButton.onTouchDown(event)) {
			resultController.newMenu();
		} return true;
		
	}

}
